package ja.lingo.engine.beans.marks;

import java.util.Date;

public class MarkImpl implements IMark {
    private Double value;
    private Date lastDate;
    private Integer count;
    private Integer type;

    public MarkImpl(Integer type) {
        this.type = type;
        this.count = 0;
        this.lastDate = null;
        this.value = .0;
    }

    public Integer getType() {
        return type;
    }

    public Double getValue() {
        return value;
    }

    public void setValue(Double value) {
        this.value = value;
    }

    public Date getLastDate() {
        return lastDate;
    }

    public void setLastDate(Date lastDate) {
        this.lastDate = lastDate;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String toString() {
        return "MarkImpl: type: " + type + " value: " + value;
    }

    public void increase() {
        setCount(getCount() + 1);
        setValue(getValue() + MarkHelper.getIncreaseStep(getType()));
    }

    public void decrease() {
        setCount(getCount() + 1);
        setValue(getValue() - MarkHelper.getDecreaseStep(getType()));
    }
}
